<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
    <input type="text" v-model="msg">
    <input type="text" v-model="msg2">
  </div>
  <script src="./vue.js"></script>
  <script>
    const vm = new Vue({
      el: "#app",
      data:{
        msg:"",
        msg2:""
      },
      watch:{
        msg(newVal, oldVal){
          console.log(`值变化了，新值是${newVal},旧值是${oldVal}`)
        },
        msg2(newVal, oldVal){
          console.log(`值变化了，新值是${newVal},旧值是${oldVal}22222`)
        }
      }
    })
  </script>
</body>
</html>
